package lee.vioson.remotedata.bean

/**
 *Author:viosonlee
 *Date:4/2/21
 *DESCRIPTION:
 */
open class BaseRsp<T>(
    var success: Boolean = false,
    var code: Int = -1000,
    var msg: String? = null,
    var data: T? = null
) {
    companion object {
        const val TOKEN_ERROR = -1 //非法token
    }

    val isSuccessAndNotEmpty: Boolean
        get() = success && data != null

    val isLoginExpired: Boolean
        get() = code == TOKEN_ERROR
}

open class BaseListRsp<T> : BaseRsp<ListData<T>>()


data class ListData<T>(val list: List<T>? = null)